﻿#ifndef SQLITE_UTILS_H
#define SQLITE_UTILS_H

#include <QString>
#include <QSqlDatabase>
#include <QMap>
#include <QVector>

class sqlite_utils
{
  public:
	static QString get_contains_name(char *db_file);
	int sync_sqlite_map(char *db_file, char *json_file);
	QSqlDatabase get_database(char *db_file);
	int create_db(char *db_file, char *json_file);
	int delete_db(char *db_file);
	QVector < QMap< QString, QString> > query(char *json_file, char *db_file, char *table_name, char *sql_command);
	int insert(char *db_file, char *json_file, QMap< QString, QMap< int, QMap<QString, QString> > > &insert_data_map);
	QMap< QString, QMap< QString, QMap<QString, QString> > > get_sqlite_map(char *json_file, char *db_file);

  private:
	QMap< QString, QMap< QString, QMap<QString, QString> > > m_sqlite_map;
};

#endif // SQLITE_UTILS_H
